package com.hongyue.chushibiao;

import java.io.*;
import java.util.ArrayList;
import java.util.Collections;

public class Demo {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("dey11\\src\\com\\hongyue\\dey09\\出师表.txt"));
        ArrayList<String> list = new ArrayList<>();
        for (String i; (i = br.readLine()) != null; ) {
            list.add(i);
        }
        list.sort((o1, o2) -> Integer.parseInt(o1.split("\\.")[0]) - Integer.parseInt(o2.split("\\.")[0]));
        BufferedWriter bw = new BufferedWriter(new FileWriter("dey11\\src\\com\\hongyue\\dey09\\出师表.txt"));
        for (String s : list) {
            bw.write(s);
            bw.newLine();
            bw.flush();
        }
        bw.close();
        br.close();
    }
}
